package com.spring.xiatian.order.controller.api;

import com.spring.xiatian.order.entity.UserOrder;
import com.spring.xiatian.order.service.OrderService;
import com.spring.xiatian.order.service.TemplateService.UserServiceTemp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Created by xiaoxia on 2017/11/30 0030 13:37.
 */
@RestController
@RequestMapping("/api")
public class OrderController {

    private final static Logger logger = LoggerFactory.getLogger(OrderController.class);

    @Autowired
    private OrderService orderService;

    @Autowired
    UserServiceTemp userServiceTemp;

    @RequestMapping(value = "/order/{id}")
    private UserOrder queryOrderById(@PathVariable(name = "id") Long id){
        return orderService.queryOrderById(id);
    }

    @RequestMapping("/list")
    private List<UserOrder> getUserOrderList(){
        return orderService.getList();
    }

    @RequestMapping("/userList")
    public String getSystemUserList(){
        String res = userServiceTemp.getUserList();
        logger.info("调用 scb-user----> res={}",res);
        return userServiceTemp.getUserList();
    }

}
